<template>
	<view >
		<view class="tabbar"></view>
		<uni-nav-bar  left-icon="left-nav"  title="父母学堂" @clickLeft="back" />
		<view class="content display-flex flex-column bg-white" >
			<view class="display-flex justify-center align-center">
				<text class="info-title">{{name}}</text>
			</view>
			<!-- <view class="margin-top-15 info-lead">
				<text>【导读】疱疹，一是指皮肤表面出现的黄白色</text>
			</view> -->
			<view class="display-flex flex-column padding-10" v-for="(know,knowIndex) in knowDetail" :key="knowIndex" >
				<text class="text-center text-bold font-size-28">{{know.title}}</text>
				<view v-html="know.content"></view>
			</view>
		</view>
	</view>
</template>

<script>
	import Header from "@/pages/component/head-top.vue";
	import apis from "@/api"
	export default {
		components:{
			Header
		},
		data() {
			return {
				knowDetail:'',
				header_title:"父母课堂 ",
				parent_name:"尊敬的",
				header_content:"科学根据宝宝当前月龄进行学习～",
				categoryList:[],
				albumList:[],
				categoryId:0,
				page:0,
				total:0,
				userInfo:'',
				currentCustomer:'',
				customer_name:'',
				on: 0,
				name:'',
				selectData: ['备孕', '怀孕', '分娩','月子']
			}
		},
		filters:{
			defaultImg(val){
				if(!val){
					return 'https://storage.ganorglobal.com/miniapp-service/static/course_icon.jpg'
				}
			}
		},
		onLoad(e){
			this.name = e.name
			this.getDetail()
		},
		onShow() {
			
			if (typeof this.$mp.page.getTabBar === 'function' && this.$mp.page.getTabBar()) {
				this.$mp.page.getTabBar().setData({
				  tabbarIndex: 2
				})
			 };
			this.userInfo = getApp().globalData.userInfo;
			this.currentCustomer = getApp().globalData.currentCustomer;
			this.customer_name = this.currentCustomer.stu_name
		},
		methods: {
			getDetail() {
				const detail = require('./detail.js')
				this.knowDetail = detail.default.data
				return
				this.knowDetail = []
				let  args = {
					sub_category_name: this.name	
				}
				this.common.http.request('/child/wiki/detail','post',args,res=>{
					if(res.data.code == 0){
						if(res.data.data.length> 0) {
							this.knowDetail = res.data.data
						}
					}
				})
			},
			back () {
				uni.navigateBack({
					delta:1
				})
			}
		}
		
	}
</script>

<style lang="scss" scoped>
	.info-title {
		font-size: 36rpx;
		font-weight: bold;
	}
	.info-lead {
		color: #8E8E93;
		font-size: 28rpx;
		background-color: #F2FCFD;
		margin: 0 30rpx;
	}
	.tabbar {
		height: var(--status-bar-height);
		width: 100%;
		background-color: white;
	}
	.bg-white {
		background-color: white;
	}
</style>
